// 定义flex等分
@for $i from 0 through 12 {
  .g-flex-#{$i} {
    flex: $i;
  }
}

// 定义字体(px)单位，大于或等于20的都为px单位字体
@for $i from 10 through 40 {
  .g-font-#{$i} {
    font-size: $i + px;
  }
}

// 定义内外边距，历遍1-80
@for $i from 0 through 80 {
  .g-m-#{$i} {
    margin: $i + px!important;
  }

  .g-p-#{$i} {
    padding: $i + px!important;
  }

  @each $short, $long in l left, t top, r right, b bottom {
    // 定义外边距
    .g-m-#{$short}-#{$i} {
      margin-#{$long}: $i + px!important;
    }

    // 定义内边距
    .g-p-#{$short}-#{$i} {
      padding-#{$long}: $i + px!important;
    }
  }
}

.g-flex {
  /* #ifndef APP-NVUE */
  display: flex;
  /* #endif */
  flex-direction: row;
  align-items: center;
}

.g-rela {
  position: relative;
}

.g-abso {
  position: absolute;
}

.g-fixed {
  position: fixed;
}

.g-flex-wrap {
  flex-wrap: wrap;
}

.g-flex-nowrap {
  flex-wrap: nowrap;
}

.g-col-center {
  align-items: center;
}

.g-col-top {
  align-items: flex-start;
}

.g-col-bottom {
  align-items: flex-end;
}

.g-row-center {
  justify-content: center;
}

.g-row-left {
  justify-content: flex-start;
}

.g-row-right {
  justify-content: flex-end;
}

.g-row-between {
  justify-content: space-between;
}

.g-row-around {
  justify-content: space-around;
}

.g-text-left {
  text-align: left;
}

.g-text-center {
  text-align: center;
}

.g-text-right {
  text-align: right;
}

.g-text-justify{
  text-align: justify;
}

/*只显几行*/
@for $i from 1 through 4 {
  .g-show-#{$i}-line{
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: $i;
    overflow: hidden;
  }
}

/*flex布局水平居右*/
.g-flex-right{
  margin-left: auto;
}

/*flex普通*/
.g-flex-row{
  display: flex;
}

/*字体加粗*/
.g-weight-font{
  font-weight: bold;
}

/*不换行*/
.g-nowrap{
  white-space: nowrap;
}

/*数字，字母换行*/
.g-break-all{
  word-break: break-all;
  white-space: normal;
}

/*高度100%*/
.g-full-height{
  height: 100%;
}

/*宽度100%*/
.g-full-width{
  width: 100%;
}

/*隐藏滚动条*/
::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  color: transparent !important;
  display: none;
}
